import { defineConfig } from 'vitepress';
import nav from './nav';
import search from './search';
import sidebar from './sidebar';
import socialLinks from './socialLinks';

export default defineConfig({
  title: '前端知识点',

  description: 'web 前端知识点总结',

  lang: 'zh',

  outDir: '../web',

  lastUpdated: true,

  outline: "deep",

  head: [
    ['meta', { name: 'keywords', content: 'HTML, CSS, JavaScript' }],
    [
      "script",
      {},
      `var _hmt = _hmt || [];
      (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?93ada88b2898b27391e31b868c369bd6";
        var s = document.getElementsByTagName("script")[0]; 
        s.parentNode.insertBefore(hm, s);
      })();`
    ]
  ],

  markdown: {
    theme: { light: 'vitesse-light', dark: 'vitesse-dark' },
    lineNumbers: true,
    headers: {
      level: [0, 0],
    },
  },

  themeConfig: {
    lang: 'zh-CN',

    logo: '/logo.png',

    siteTitle: '前端知识点',

    lastUpdatedText: '更新时间',

    outline: [2, 3],

    outlineTitle: "本页目录",

    darkModeSwitchLabel: '配色方案',

    sidebarMenuLabel: '菜单',

    returnToTopLabel: '返回顶部',

    langMenuLabel: '语言切换',

    cleanUrls: true,

    search,

    socialLinks,

    nav,  // 顶部导航栏
    sidebar, // 左侧导航栏

    docFooter: { prev: '上一篇', next: '下一篇' },

    footer: {
      message: 'Released under the MIT License.',
      copyright: 'Copyright © 2017-2023 <a href="https://ixook.com" target="_blank">ixook.com</a> 版权所有 <a href="https://beian.miit.gov.cn" target="_blank">苏ICP备14015141号</a>'
    }
  }
})